﻿namespace CN2P.ServiceModel.ServiceClients
{
    public class ECommerceServiceClient
    {
        private readonly CartServiceClient cartService;
        private readonly ProductsServiceClient productsService;
        private readonly UserSessionServiceClient sessionService;
        private readonly RecommendationsServiceClient recommendationsService;
        private readonly OrdersServiceClient ordersService;

        public ECommerceServiceClient(ECommerceServiceClientConfiguration config)
        {
            this.cartService = new CartServiceClient(config.CartsUri);
            this.productsService = new ProductsServiceClient(config.ProductsUri);
            this.sessionService = new UserSessionServiceClient(config.SessionUri);
            this.recommendationsService = new RecommendationsServiceClient(config.RecommendationsUri);
            this.ordersService = new OrdersServiceClient(config.OrdersUri);
        }

        public CartServiceClient CartService
        {
            get { return this.cartService; }
        }

        public ProductsServiceClient ProductsService
        {
            get { return this.productsService; }
        }

        public UserSessionServiceClient SessionService
        {
            get { return this.sessionService; }
        }

        public RecommendationsServiceClient RecommendationsService
        {
            get { return this.recommendationsService; }
        }

        public OrdersServiceClient OrdersService
        {
            get { return this.ordersService; }
        }
    }
}
